Webhook: COMMENT_CREATED
Overview
The COMMENT_CREATED webhook triggers when a new comment is added to an incident or task. It notifies the system or users about the creation of the comment, facilitating tracking of updates, discussions, or changes associated with the relevant tasks or incidents.
Purpose
The webhook ensures stakeholders or systems are promptly informed whenever a new comment is added, helping to maintain awareness of ongoing communication or updates related to tasks or incidents.
Request Format
The webhook sends an HTTP POST request with the following JSON payload:
{
"entityId": "eb6c9de2-8969-4568-8fb1-cc4d99962ec1",
"type": "COMMENT_CREATED",
"createdAt": "2024-12-16T12:20:28.647Z",
"data": {
"operation": "INSERT",
"current": {
"id": "eb6c9de2-8969-4568-8fb1-cc4d99962ec1",
"organizationId": "9864d894-699a-4a00-8d4c-ae181215d721",
"createdBy": "6ad1a95b-ea50-4e23-8495-ef82900ca98d",
"relatedEntityId": "9af5d7b0-b1e2-4436-b02e-1c6346eb09d1",
"relatedEntityType": "TASK",
"message": "New comment!"
},
"previous": null
},
"id": 201
}
Key Properties
Top-Level Fields
- entityId: Unique identifier of the comment.
- type: Specifies the webhook type (
COMMENT_CREATED). - createdAt: Timestamp when the webhook was created in ISO 8601 format.
- data: Contains detailed information about the new comment.
Data Fields
Operation
- operation: Describes the action performed. For new comments, this is always
INSERT.
Current (New Comment) Data
- id: Unique identifier of the comment.
- organizationId: Identifier for the organization associated with the comment.
- createdBy: Identifier of the user who created the comment.
- relatedEntityId: Identifier of the related task or incident.
- relatedEntityType: Specifies whether the related entity is a
TASKor anISSUE. - message: The text content of the comment.
Previous
- previous: Data of the comment before the current operation. For new comments, this field is always
null.
Example Response
A sample payload for a successful webhook trigger:
{
"entityId": "eb6c9de2-8969-4568-8fb1-cc4d99962ec1",
"type": "COMMENT_CREATED",
"createdAt": "2024-12-16T12:20:28.647Z",
"data": {
"operation": "INSERT",
"current": {
"id": "eb6c9de2-8969-4568-8fb1-cc4d99962ec1",
"organizationId": "9864d894-699a-4a00-8d4c-ae181215d721",
"createdBy": "6ad1a95b-ea50-4e23-8495-ef82900ca98d",
"relatedEntityId": "9af5d7b0-b1e2-4436-b02e-1c6346eb09d1",
"relatedEntityType": "TASK",
"message": "New comment!"
},
"previous": null
}
}
Benefits
- Real-Time Collaboration: Ensures all participants are promptly notified of new comments for effective collaboration.
- Improved Tracking: Enables systems and users to keep track of updates or discussions related to tasks or incidents.
- Streamlined Communication: Automates the process of notifying stakeholders, reducing the chance of missing critical updates.
The COMMENT_CREATED webhook simplifies communication management by ensuring timely updates on all newly added comments.